#!/bin/bash

host=$1

function amp {
  echo "============================================="
  call=http://$host/amp/0/$1
  echo $call
  curl $call
  echo
}

function dogvibes {
  echo "============================================="
  call=http://$host/dogvibes/$1
  echo $call
  curl $call
  echo
}

function dogsleep {
  echo -n "dogsleep $1 sec..."
  sleep $1
  echo "done"
  echo
}

amp "queue?uri=spotify:track:4sYoILaSnD8j3iXarRClXT"
amp "queue?uri=spotify:track:3lW5j4AqazRxwdVaz4svpZ"
amp "queue?uri=spotify:track:6xg3JlGpWrnHXZnTHT3UCt"
amp "queue?uri=spotify:track:0AGv4OkL2oAWYiAEZSyIDA"

amp "getAllTracksInQueue"

amp "play"
dogsleep $2

amp "nextTrack"
dogsleep 5

amp "nextTrack"
dogsleep 7

amp stop
dogsleep 4

amp "play"
dogsleep 15

amp stop
